package com.sgb.goods.view.activity.details.order;

import androidx.recyclerview.widget.GridLayoutManager;

import com.alibaba.android.arouter.facade.annotation.Route;
import com.sgb.goods.BR;
import com.sgb.goods.R;
import com.sgb.goods.databinding.GoodsActivityTradingContractBinding;
import com.sgb.goods.utils.Constants;
import com.sgb.goods.utils.base.BaseActivity;
import com.sgb.goods.viewmodel.TradingContractViewModel;

/**
 * 采购商要求
 * @author cyj
 */
@Route(path = Constants.ARouter.AR_TRADING_CONTRACT)
public class TradingContractActivity extends BaseActivity<GoodsActivityTradingContractBinding, TradingContractViewModel> {

    @Override
    protected int getLayoutResId() {
        return R.layout.goods_activity_trading_contract;
    }

    @Override
    protected void initViewModel() {
        mViewModel = createViewModel(TradingContractViewModel.class, BR.viewModel);
    }

    @Override
    protected void init() {
        mDataBinding.head.title.setText("采购商要求");
        mViewModel.getTradingContractContent(getIntent().getStringExtra("orderId"));
        mDataBinding.rlvTradingServer.setLayoutManager(new GridLayoutManager(this, 2));
        mDataBinding.rlvTradingServer.setAdapter(mViewModel.serverAdapter);
    }

    @Override
    protected void initListener() {
        mDataBinding.head.ivBack.setOnClickListener(v -> finish());
    }
}